< previous page page_532 next page >

Page 532
A common misconception is that the optimization process takes place at the end of the application development. To create a truly optimized application, you must be optimizing it at the same time that you're developing it. By choosing your algorithms carefullyweighing speed against size and other constraintsyou should be able to tell which parts of the application will be fast or slow, large or compact.
If you don't start with a clear goal in mind, you could waste time optimizing the wrong areas of your application. Everything you do should be based on user needs and expectations. The key to the optimization process is to understand the real problem that optimization will address. If you're like most programmers, you don't want to take the time to optimize everything in your application. Because of time, it's obvious that you should focus on the areas that seem to be the slowest or fattest. But to make the results of your efforts count, you should concentrate on the code where a little work will make a lot of difference.
Using the LightWeight Controls
Another way to get the application to perform better is by making use of a new set of controls that come with Visual Basic 6. These controls are called LightWeight controls because they take up less system resources then do the standard versions of the same controls. The set of LightWeight controls consist of the following:
CheckBox
ComboBox
Command button
Frame
Horizontal and Vertical Scrollbars
ListBox
Option button
TextBox
These LightWeight controls, sometimes called windowless controls, differ from the regular controls in one very significant way, they do not have a Windows Handle property (hWnd). Because of this, they will use fewer resources, making them the controls of choice wherever system resources may be a limiting factor. These controls are contained in the MSWLESS.OCX file; however, they are not automatically installed on your computer.

 
< previous page page_532 next page >

If you like this book, buy it!